Using a NULL GAppInfo with g_app_launch_context_get_display() will
generate a critical warning in gio.
Use the display name instead as we don't have any valid GAppInfo to pass
to g_app_launch_context_get_display().
bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=756439
_gdk_x11_display_get_app_launch_context (GdkDisplay *display)
{
GdkAppLaunchContext *ctx;
- static gchar *display_name;
+ const gchar *display_name;
ctx = g_object_new (GDK_TYPE_X11_APP_LAUNCH_CONTEXT,
"display", display,
NULL);
- display_name = g_app_launch_context_get_display (G_APP_LAUNCH_CONTEXT (ctx),
- NULL, NULL);
+ display_name = gdk_display_get_name (display);
if (display_name)
g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx),
"DISPLAY", display_name);